home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / FILER / TARSRC.SPK / c / stat < prev    next >
Text File  |  1990-07-09  |  691b  |  37 lines

  1. #include <stdlib.h>
  2. #include "os.h"
  3. #include "swis.h"
  4.  
  5. #include "stat.h"
  6.  
  7. int stat(char *FileName, struct stat *Buf)
  8. {
  9.   os_filestr Blk;
  10.  
  11.   Blk.action = 5;
  12.   Blk.name = FileName;
  13.   if (os_file(&Blk) != NULL)
  14.     return 1;
  15.   Buf->st_load_address = Blk.loadaddr;
  16.   Buf->st_exec_address = Blk.execaddr;
  17.   Buf->st_size = Blk.start;
  18.   Buf->st_attr = Blk.end;
  19.   Buf->st_type = Blk.action;
  20.   if (Buf->st_type == 0)
  21.     return 1;
  22.   return 0;
  23. } /* stat */
  24.  
  25.  
  26. void wstat(char *FileName, struct stat *Buf)
  27. {
  28.   os_filestr Blk;
  29.  
  30.   Blk.action = 1;
  31.   Blk.name = FileName;
  32.   Blk.loadaddr = Buf->st_load_address;
  33.   Blk.execaddr = Buf->st_exec_address;
  34.   Blk.end = Buf->st_attr;
  35.   os_file(&Blk);
  36. } /* wstat */
  37.